<?php
namespace app\api\controller;

class Invoice extends Base
{

    public function _initialize()
    {
        parent::_initialize();
        //$this->chkToken();
    }

    public function getInvoiceList()
    {
        if (! isset($this->request['order_ids'])) {
            $return['success'] = false;
            $return['desc'] = '没有传入订单编号';
            $this->ajaxReturn($return);
        }
        $temp = explode(',', $this->request['order_ids']);
        $post['member_id'] = $this->member_id;
        $return['result'] = array();
        for ($i = 0; $i < count($temp); $i ++) {
            $post['order_no'] = $this->request['order_ids'];
            $data = $this->sendInfo('getInvoiceInfo', $post);
            if ($data['count'] > 0) {
                $return['result'][$temp[$i]] = array(
                    $data['data']['invoice_proof']['save_path']
                );
            }
        }
        $return['success'] = true;
        $this->ajaxReturn($return);
    }
}